package com.company.demo3;

public class TestFebonacci {

    public static void main(String[] args) {
        //斐波那契数列
        int febonacci = febonacci(7);
        System.out.println(febonacci);
    }

    //打印第n向斐波那契数列
    public static int febonacci(int i){
        if (i==1 || i==2){
            return 1;
        }else {
            return febonacci(i-1)+febonacci(i-2);
        }
    }

}
